Search
Other Conditional Content questions
Forum

{show} expression not working

Jonathan Asbell's Avatar Jonathan Asbell
Trying to show if a query parameter of "email" exists in the URL with a valid email
{show urls="(&|\?)email=[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+" urls_regex="true"}has an email param{/show}
Its not showing

I am going to be checking for email and also a parameter representing a form field with multiple answers

www.realplaces.io/team/paula-s-dynamic-p...mail=

Confidential information:
(hidden)
Peter van Westen's Avatar Peter van Westen ADMIN
I just tried it here and works fine on my setup.
The Regular Expressions are done case insensitive by default, so you can simply do:
{show urls="(&|\?)email=[a-z0-9+_.-]+@[a-z0-9]" urls_regex="true"}

PS: The page you linked to doesn't seem to exist, or I have no access.
Please post a rating at the Joomla! Extensions Directory
Jonathan Asbell's Avatar Jonathan Asbell
Sorry, Was an ACL issue now you can see
Jonathan Asbell's Avatar Jonathan Asbell
Mine says
Error
You are not authorised to view this resource.
Peter van Westen's Avatar Peter van Westen ADMIN
Well... not being able to access the page has nothing to do with Conditional Content.
Please post a rating at the Joomla! Extensions Directory
Jonathan Asbell's Avatar Jonathan Asbell
sorry about that Pete I had an AC l setup that I didn't remember to unlock. I appreciate it.

let me ask is this nestable? in other words if I want to have multiple conditions do I nest them or do I separate them with commas
Peter van Westen's Avatar Peter van Westen ADMIN
You can't nest them.
You can't put multiple Regular Expressions inside 1 tag using a comma. You would have to make the Regular Expression smarter to match all the cases you need.
Please post a rating at the Joomla! Extensions Directory
Jonathan Asbell's Avatar Jonathan Asbell
let me ask this a different way. I want to test for the existence of a valid email parameter being sent and then based on other parameters that might be present I want to display pieces of content. the presence of the email parameter is the master condition that must exist for any of the fields to display, and then I want to display each field if the correct matching parameter is in the URL for each one individually. how would I accomplish this?
Peter van Westen's Avatar Peter van Westen ADMIN
You would have to do something like this:
{show urls="[&\?]email=[a-z0-9+_.-]+@[a-z0-9].*?some-condition=for-field-1" urls_regex="true"}
... code for field 1 ...
{/show}
{show urls="[&\?]email=[a-z0-9+_.-]+@[a-z0-9].*?some-other-condition=for-field-2" urls_regex="true"}
... code for field 2 ...
{/show}
Please post a rating at the Joomla! Extensions Directory
Jonathan Asbell's Avatar Jonathan Asbell
Thanks. Would be nice if it were evetually nestable =)
Jonathan Asbell's Avatar Jonathan Asbell
I think I have a solution

{hide urls="(&|\?)email=[a-z0-9+_.-]+@[a-z0-9.-]+" urls_regex="true"}<!--{/hide}

{show urls="(&|\?)answer=answer1" urls_regex="true"}this is answer 1{/show}
{show urls="(&|\?)answer=answer2" urls_regex="true"}this is answer 2{/show}
{show urls="(&|\?)answer=answer3" urls_regex="true"}this is answer 3{/show}

{hide urls="(&|\?)email=[a-z0-9+_.-]+@[a-z0-9.-]+" urls_regex="true"}-->{/hide}
Peter van Westen's Avatar Peter van Westen ADMIN
You can probably nest the show tags inside the hide tags.
Please post a rating at the Joomla! Extensions Directory
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription